<style>
	.cycle{
		display: none;
	}
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="row">
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-project_id" class="control-label col-xs-12 col-sm-2">{:__('项目')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-project_id"  data-source="workteam/project/index" data-field="name"
                       class="form-control selectpage" name="row[project_id]" type="text" value="{$row.project_id}" disabled>

            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-pid" class="control-label col-xs-12 col-sm-2">{:__('父任务')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-pid"  data-source="workteam/task/index" data-field="name"
                       class="form-control selectpage" name="row[pid]" type="text" value="{$row.id}" disabled>
                    <span class="text-red">*不能修改</span>
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('任务名称')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-name" data-rule="required" type="text" class="form-control" name="row[name]" value=""/>
            </div>
        </div>


		<div class="col-md-4 col-xs-12 form-group">
            <label for="c-cycle" class="control-label col-xs-12 col-sm-2">{:__('任务周期')}:</label>
            <div class="col-xs-12 col-sm-8">
				{:build_radios('cycle', ['0'=>'单次', '1'=>'每天', '2'=>'每周', '3'=>'每月', '4'=>'遗忘曲线'], 0)}
            </div>
        </div>
		<div class="cycle" id="cycle-day">
			<div class="col-md-4 col-xs-12 form-group">
				<label class="control-label col-xs-12 col-sm-2">{:__('每天')}:</label>
				<div class="col-xs-12 col-sm-3">
					<input value="00:00" class="form-control datetimepicker" data-rule="required"
						   data-date-format="HH:mm" data-use-current="true" name="day_start_time" type="text">
				</div>
				<label class="control-label col-xs-12 col-sm-1">{:__('到')}:</label>
				<div class="col-xs-12 col-sm-3">
					<input value="00:00" class="form-control datetimepicker" data-rule="required"
						   data-date-format="HH:mm" data-use-current="true" name="day_end_time" type="text">
				</div>
			</div>
		</div>
		<div class="cycle" id="cycle-week">
			<div class="col-md-4 col-xs-12 form-group">
				<label class="control-label col-xs-12 col-sm-2">{:__('每周')}:</label>
				<div class="col-xs-12 col-xs-8">
					{:build_select('cycle_week[]',['1'=>'周一','2'=>'周二','3'=>'周三','4'=>'周四','5'=>'周五','6'=>'周六','7'=>'周天'],'',['class'=>'form-control selectpicker', 'multiple'=>'true'])}
				</div>
			</div>
			<div class="col-md-4 col-xs-12 form-group">
				<label class="control-label col-xs-12 col-sm-2"></label>
				<div class="col-xs-12 col-sm-2">
					<input value="00:00" class="form-control datetimepicker" data-rule="required"
						   data-date-format="HH:mm" data-use-current="true" name="week_start_time" type="text">
				</div>
				<label class="control-label col-xs-12 col-sm-1">{:__('到')}:</label>
				<div class="col-xs-12 col-sm-2">
					<input value="00:00" class="form-control datetimepicker" data-rule="required"
						   data-date-format="HH:mm" data-use-current="true" name="week_end_time" type="text">
				</div>
			</div>
		</div>
		<div class="cycle" id="cycle-month">
			<div class="col-md-4 col-xs-12 form-group">
				<label class="control-label col-xs-12 col-sm-2">{:__('每月')}:</label>
				<div class="col-xs-12 col-sm-6">
					{:build_select('cycle_month[]',$month_days,'',['class'=>'form-control selectpicker', 'multiple'=>'true'])}
				</div>
				<label class="control-label col-xs-12 col-sm-1">{:__('号')}</label>
			</div>
			<div class="col-md-4 col-xs-12 form-group">
				<label class="control-label col-xs-12 col-sm-2"></label>
				<div class="col-xs-12 col-sm-2">
					<input value="00:00" class="form-control datetimepicker" data-rule="required"
						   data-date-format="HH:mm" data-use-current="true" name="month_start_time" type="text">
				</div>
				<label class="control-label col-xs-12 col-sm-1">{:__('到')}:</label>
				<div class="col-xs-12 col-sm-2">
					<input value="00:00" class="form-control datetimepicker" data-rule="required"
						   data-date-format="HH:mm" data-use-current="true" name="month_end_time" type="text">
				</div>
			</div>
			<div class="col-md-4 col-xs-12 form-group">
				<label class="control-label col-xs-12 col-sm-2"></label>
				<span class="text-red ">{:__('*注意有些月份可能没有29，30，31日')}</span>
			</div>
		</div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-start_time" class="control-label col-xs-12 col-sm-2">{:__('开始时间')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-start_time" value="{:datetime(time())}"  data-rule="required" class="form-control datetimepicker"
                       data-date-format="YYYY-MM-DD HH:mm" data-use-current="true" name="row[start_time]" type="text">
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-end_time" class="control-label col-xs-12 col-sm-2">{:__('截止时间')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-end_time" value="" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm"
                       data-use-current="true" name="row[end_time]" type="text">
                <span class="text-red text-end_time">{:__('最迟')}{:datetime($row.end_time)}</span>
            </div>


        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-plan_hours" class="control-label col-xs-12 col-sm-2">{:__('安排工时')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-plan_hours" type="number" class="form-control" data-rule="required" name="row[plan_hours]" value="0"/>
                <span class="text-red text-plan_hours">{:__("剩余")}{$row.get_hours}{:__("工时")}</span>
            </div>
        </div>


        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-group_id" class="control-label col-xs-12 col-sm-2">{:__('归属部门')}:</label>
            <div class="col-xs-12 col-sm-8">
                {:build_select('row[group_id]', $groupdata, $row['group_id'], ['class'=>'form-control selectpicker', 'id'=>'c-group_id'])}
                <span class="help-block"></span>
            </div>
        </div>


        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-admin_id" class="control-label col-xs-12 col-sm-2">{:__('负责人')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-admin_id" data-rule="required"  data-source="workteam/common/selectpage/model/admin/type/all" data-field="nickname"
                       class="form-control selectpage" name="row[admin_id]" type="text" value="{$auth->id}">

            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-admin_ids" class="control-label col-xs-12 col-sm-2">{:__('参与人')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-admin_ids"  data-source="workteam/common/selectpage/model/admin/type/all" data-multiple="true" data-field="nickname"
                       class="form-control selectpage" name="row[admin_ids]" type="text" value="">
                <span class="help-block">*只有查看权限，获得不了工时</span>
            </div>
        </div>
        <div class="form-group col-md-4 col-xs-12">
            <label class="control-label col-xs-12 col-sm-2">{:__('优先级')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select id="c-level" class="form-control selectpicker" name="row[level]">
                    {foreach name="levelList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.level" }selected{/in}>{$vo}</option>
                    {/foreach}
                </select>
                <span class="text-red "></span>
            </div>
        </div>

        <div class="form-group col-md-4 col-xs-12">
            <label class="control-label col-xs-12 col-sm-2">{:__('任务状态')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select id="c-status" class="form-control selectpicker" name="row[status]">
                    {foreach name="statusList" item="vo"}
                    <option value="{$key}" {in name="key" value="0" }selected{/in}>{$vo}</option>
                    {/foreach}
                </select>
                <span class="text-red ">{:__('*完成的任务不能再修改')}</span>
            </div>
        </div>

        <div class="form-group col-md-4 col-xs-12">
            <label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('附件')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group">
                    <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="" placeholder="可以为空">
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="plupload-image" class="btn btn-danger  plupload" data-input-id="c-image" data-mimetype="*" data-multiple="true" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('上传')}</button></span>
                        <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="*" data-multiple="true" data-preview-id="p-image"><i class="fa fa-list"></i> {:__('选择')}</button></span>

                    </div>
                    <span class="msg-box n-right" for="c-image"></span>
                </div>
                <ul class="row list-inline plupload-preview" id="p-image"></ul>
            </div>
        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('任务内容')}:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea id="c-content" class="form-control editor" name="row[content]"></textarea>

            </div>
        </div>

    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>





